package com.chnbst.bstyun.service.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.chnbst.bstyun.core.base.BaseService;
import com.chnbst.bstyun.core.common.helper.DaoHelper;
import com.chnbst.bstyun.model.pojo.OtherFile;
import com.chnbst.bstyun.service.OtherFileService;

/**
 * @author zqh
 * @date 2014年9月22日
 * 
 */
@Transactional
@Service
public class OtherFileServiceImpl extends BaseService implements OtherFileService {

	//声明日志对象 logback
	private final static Logger logger = LoggerFactory.getLogger(OtherFileServiceImpl.class);
	private final static String nameSpace = "com.chnbst.bstyun.mapper.OtherFileMapper";
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public OtherFile getOtherFileById(Integer downloadId) {
		return (OtherFile)DaoHelper.query(nameSpace, "selectOtherDownloadById", downloadId);
	}
	
	@SuppressWarnings("unchecked")
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public List<OtherFile> getOtherFile() {
		return (List<OtherFile>) DaoHelper.list(nameSpace, "selectOtherDownload", null);
	}

}
